#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/stat.h>
#include <string.h>

void printFilesInDirectory(const char *dirPath) {
    struct dirent *entry;
    DIR * dir=opendir(dirPath);
    if(dir==NULL)
    {
        return;
    }
    while((entry=readdir(dir))!=NULL)
    {
        if(entry->d_name[0]=='.')
        {
            continue;
        }
        printf("%s/%s\n",dirPath,entry->d_name);
        char filename[1024]={0};
        snprintf(filename,sizeof(filename),"%s/%s",dirPath,entry->d_name);
        if(entry->d_type==4)
        {
            printFilesInDirectory(filename);
        }

    }
     closedir(dir);

}

int main() {
    const char *dirPath = ".";  // 目标目录，"." 表示当前目录
    printFilesInDirectory(dirPath);
    return 0;
}